//导入请求工具类
import request from '@/utils/request.js'


//获取账单
export const billListGetService = ()=>{
    return request.get('/bill/getBillList');
}
//获取今日收入
export const billSumGetService = ()=>{
    return request.get('/bill/getSumBill');
}
//充值
export const depositsService = (amount) => {
    return request.post('/bill/deposits', { amount: parseFloat(amount).toFixed(2) }) // 转换为两位小数
        .then(response => {
            return response.data;
        })
        .catch(error => {
            console.error('Error:', error);
            throw error; // 重新抛出错误以便在调用处捕获
        });
}
//提现
export const withdrawalsService = (amount) => {
    return request.post('/bill/withdrawals', { amount: parseFloat(amount).toFixed(2) }) // 转换为两位小数
        .then(response => {
            return response.data;
        })
        .catch(error => {
            console.error('Error:', error);
            throw error; // 重新抛出错误以便在调用处捕获
        });
}
//获取采购商财务管理的饼状图
export const getPOrderInfoService = () => {
    return request.get('/t-order/getPOrderInfo')
}
